package cn.witsky.rtp2ws.util;

public class CapcityUtil {
	public static final int tableSizeFor(int cap) {  
		  int n = cap - 1;  
		  n |= n >>> 1;  
		  n |= n >>> 2;  
		  n |= n >>> 4;  
		  n |= n >>> 8;  
		  n |= n >>> 16;  
		  return n + 1;  
	}
	
	public static int getTime() {
		int count = Runtime.getRuntime().availableProcessors() / 8;
		if(count==0) {
			count=1;
		}
		return count;
	}
}
